{extend name="template/base" /}
{block name="style"}
<!--select2样式 start -->
<link href="__LIB__/select2-4.0.3/dist/css/select2.min.css" rel="stylesheet" />
<!--select2样式 end -->
{/block}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">题目：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="题目" name="title" value="{$vo.title ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">题型：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <select name="type" class="select2"  id="type">
                    {empty name = "$vo['type']"}
                    <option value="">选择题型</option>
                    {/empty}
                    {volist name=":config('question_type')" id="type"}
                    <option value="{$key}"  >{$type}</option>
                    {/volist}
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>




        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">考核司机等级：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <select name="rank_id" class="select2"  id="rank_id">
                    {empty name = "$vo['rank_id']"}
                    <option value="">选择等级</option>
                    {/empty}
                    {volist name="rank_list" id="rank"}
                    <option value="{$rank['id']}"  >{$rank['name']}</option>
                    {/volist}
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">解析：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <textarea  cols="" rows=""name="analysis"  class="textarea" placeholder="解析">{$vo.analysis ?? ''}</textarea>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">内容：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <textarea  cols="" rows=""name="content"  class="textarea" placeholder="内容">{$vo.content ?? ''}</textarea>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<!--select2 js 插件-->
<script type="text/javascript" src="__LIB__/select2-4.0.3/dist/js/select2.min.js"></script>
<script>
    $(function () {
;

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        var type = $("#type").select2({
            language: "zh-CN", //设置 提示语言
            width: "100%", //设置下拉框的宽度
            theme: "classic"
        });
        {notempty name = "vo['type']"}
        type.val("{$vo['type']}").trigger("change");
        {/notempty}

        var rank_id = $("#rank_id").select2({
            language: "zh-CN", //设置 提示语言
            width: "100%", //设置下拉框的宽度
            theme: "classic"
        });
        {notempty name = "vo['rank_id']"}
        rank_id.val("{$vo['rank_id']}").trigger("change");
        {/notempty}

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
